package com.ziqikeji.businessDelegate;

import java.util.HashMap;
import java.util.Map;

/**
 * BusinessLookUp类：业务查询类，有点类似于业务实现的工厂模式
 */
public class BusinessLookUp {
    private static final String EJB_SERVICE_NAME = "EJB";
    private static final Map<String ,BusinessService> businessServiceMap = new HashMap<>();

    static {
        businessServiceMap.put("com.ziqikeji.businessDelegate.EJBService",new EJBService());
        businessServiceMap.put("com.ziqikeji.businessDelegate.JMSService",new JMSService());
    }

    public BusinessService getBusinessService(String serviceType) {
        return businessServiceMap.get(serviceType);
    }
}
